<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="vue.min.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="浪起来" @click="lang" />
        <input type="button" value="低调" @click="stop"/>
        <h2>{{ msg }}</h2>
    </div>
</body>

<script>

    var vm = new Vue({
        el: '#app',
        data: {
            msg: '猥琐发育，别浪~~~！！',
            intervalId: null
        },
        methods: {
            lang() {
                // clearInterval(this.intervalId);
                if ( this.intervalId !== null ) return;                
                this.intervalId = setInterval( () => {
                    var star = this.msg.substring(0,1);
                    var end = this.msg.substring(1);
                    this.msg = end + star;
                },100);
            },
            stop(){
                clearInterval(this.intervalId);
                this.intervalId = null;
            }
        }
    });


</script>


</html>